package com.hhly.rabbitmq.spring.consumer;

import java.io.UnsupportedEncodingException;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;
import org.springframework.stereotype.Component;

@Component
public class TaskListenter implements MessageListener {

	@Override
	public void onMessage(Message message) {
		 try {
			Integer pri = message.getMessageProperties().getPriority();
			System.out.println(pri + new String(message.getBody(),"UTF-8"));
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
